home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / DIAGTOOL / MICFFT11.ZIP;1 / MICFFT11.TXT < prev   
Encoding:
Text File  |  1993-03-31  |  30.4 KB  |  567 lines

  1.                                 MicFFT v1.1
  2.                               March 31, 1993
  3.  
  4.                         Written by Craig M. Walsh
  5.                               CIS 70701,1614
  6.                   Internet: Walsh@biovx1.dnet.nasa.gov
  7.                             Walsh@129.97.26.1
  8.  
  9.  
  10.     Introduction:
  11.  
  12.     MicFFT is a program that samples data from a sound card or
  13.     addressable analog-to-digital (ADC) port, and plots out the
  14.     spectral features of the sampled waveform.  The program utilizes
  15.     a Fast Fourier Transform (FFT) algorithm to transform the
  16.     sampled data (in the time domain) to the frequency domain.  The
  17.     program gets 256 Pulse Code Modulated (PCM-see below) samples
  18.     from the ADC at a defined sampling rate, and then plots the
  19.     transformed data.  MicFFT continuously loops between sampling
  20.     and plotting.  Thus, the program acts somewhat like a realtime
  21.     spectrum analyzer, and on fast machines with fast sound cards,
  22.     is capable of impressive performance.  MicFFT can be likened to
  23.     spectrum analyzers found on some audio equalizers, and can
  24.     provide detailed information on the spectral components and
  25.     relative intensities of continuous waveforms.
  26.  
  27.  
  28.     Improvements in version 1.1:
  29.  
  30.     Since many of you heeded my call for comments in the last
  31.     version, I was able to gain insight into what improvements to
  32.     include in this version of MicFFT.  The main problem I found was
  33.     that the original version of MicFFT did not support Sound
  34.     Blaster or Sound Blaster-compatible cards, even though I
  35.     presumed it might.  After some investigation, I found that
  36.     sampling on the SB card requires quite a bit of additional code
  37.     that was not included in the original version of MicFFT.  Since
  38.     I don't have an SB card (I have a Covox Sound Master II, and am
  39.     quite happy with it so far!), I had to find someone out there
  40.     with one to help out.  Fortunately, Chris Pye decided to join
  41.     the MicFFT "development team", and has supplied the SB sampling
  42.     routines (along with additional ideas, etc.) for this new
  43.     version.  Now, MicFFT v1.1 has explicit support for SB 8-bit
  44.     cards (16 bit sampling is, sadly, not included yet).
  45.     Additionally, other cards that have Sound Blaster compatibility
  46.     should also work with MicFFT (see Compatibility); I hope this
  47.     time I don't eat my words!
  48.  
  49.     MicFFT also has a new function that provides for freezing
  50.     waveform sampling and allows detailed analysis of the frozen
  51.     waveform.  This function has a positionable cursor-line, which
  52.     can be used to determine the frequency and amplitude of a
  53.     specific band on the plot.  The program also has a new plotting
  54.     mode that allows plots to be generated in either bar graph
  55.     style, as implemented in the original version, or line graph
  56.     style, which produces output that may be more suitable to
  57.     certain applications.  Output is also scaled in decibel (dB)
  58.     steps.  Some new filtering options have been added to MicFFT
  59.     v1.1; Squelch allows filtering of spurious noise below a set
  60.     threshold; Cosine envelope is used to reduce transformation
  61.     errors resulting from sampling discontinuities (see Cosine
  62.     Envelope, below).  In addition, certain bugs that were not
  63.     identified before the original release have been fixed (I hope).
  64.  
  65.  
  66.     Requirements:
  67.  
  68.     MicFFT is a computing-intensive program and requires a fast
  69.     computer for achieving rapid output.  It was developed on a
  70.     33MHz 486-DX (with floating-point coprocessor), with SVGA, a
  71.     Covox SoundMaster II sound card.  Graphics modes tested include
  72.     both EGA and VGA, so both should work (see Options).  MicFFT
  73.     will look for a coprocessor (and will run much faster if one is
  74.     found), but will emulate one if a coprocessor is found.
  75.     Additionally, some 286-specific code is included for speed, and
  76.     thus it will not work properly on machines with lesser
  77.     processors.  Since the sampling routine is timed and independent
  78.     of the transformation and plotting, the speed of a particular
  79.     machine should not affect the accuracy of frequency output; only
  80.     the rate at which data is plotted will be affected.
  81.  
  82.  
  83.     Supported Sound Cards:
  84.  
  85.     As stated above, this version of MicFFT explicitly supports the
  86.     Covox SoundMaster II (default) and the Sound Blaster cards for
  87.     8-bit sampling.  The Sound Blaster mode, which includes
  88.     additional code for sending commands to control the sampling
  89.     specifics, is available using the -B1 flag (see Options).  Other
  90.     cards may work as well, particularly if some means for Sound
  91.     Blaster compatibility is provided by the card.  For example, the
  92.     Pro Audio Spectrum card may work if a Sound Blaster
  93.     compatability driver for that card is loaded before running
  94.     MicFFT.  This has not been tested yet, but you should check out
  95.     your sound card documentation for specifics.  Covox
  96.     compatibility (default) is likely not explicitly provided by
  97.     other sound card vendors.  However, it may be generally useful
  98.     to those whose cards are capable of polling the ADC
  99.     independently (without explicit commands for controlling
  100.     sampling); MicFFT provides a means for changing the default ADC
  101.     port address.  In the Covox mode, MicFFT simply looks for data
  102.     at this port at a defined rate using timing routines in the
  103.     program.  The default port address included in the program is
  104.     22F (hex).  This is actually a port address (0x220h) and ADC
  105.     offset (0x00F) added together.  If you have a card where a port
  106.     address is given in the documentation, and an ADC input offset
  107.     is also given, just add the two together (using a hex
  108.     calculator) and use the -P flag to let MicFFT know which address
  109.     you need to use.  I realize that this discussion may be a bit
  110.     technical, but I provide it so that users with cards other than
  111.     the above mentioned can attempt to figure out which options to
  112.     alter.  I know that incompatibility is frustrating, so if you
  113.     have a card which is not explicitly supported (and there is
  114.     really a growing list), I will include compatibility for such
  115.     cards for those who can get me specific code for PCM sampling.
  116.     I prefer to have short code segments (in C, or assembler if
  117.     possible) to look at rather than libraries, since I need to be
  118.     able to control some of the aspects of sampling, and I need you
  119.     to volunteer for testing the modified code.  Contact me at the
  120.     address provided (see Contacting the Author), and I will happily
  121.     discuss your specific needs.  (It should be noted that I may
  122.     decide to port MicFFT to Windows, if I can pull together some
  123.     cash for buying a Windows C compiler.  This would be helpful,
  124.     since compatibility would not be an issue here.)
  125.  
  126.  
  127.     Lesson 1.  PCM sampling:
  128.  
  129.     Sampling is a process whereby a continuous stream of data is
  130.     broken up into chunks of data usable by the sampling system.
  131.     PCM sampling is a process whereby this continuous data is polled
  132.     at a defined rate.  Since we are interested in analog signals
  133.     most of the time (the type that enter our sound cards via the
  134.     ADC port), it is necessary to first transform the data from an
  135.     analog representation to a digital one.  This is the job of the
  136.     ADC.  This process is fairly complicated, but suffice it to say
  137.     that an analog value (from - infinity to + infinity) is
  138.     transformed to an explicit digital value.  Since the digital
  139.     value can represent only a discrete value, there may be some
  140.     loss of resolution in this transformation.  16 bit cards (which
  141.     can represent 64K different input levels) are much more accurate
  142.     for this purpose than 8 bit cards (which only can reproduce 256
  143.     different levels).  Also, since PCM-sampling assumes that the
  144.     analog waveform has components on either side of zero (i.e.
  145.     negative and positive parts of a wave), one half of the digital
  146.     range is negative, the other half positive.  This reduces the
  147.     number of possible digital absolute value amplitudes by a factor
  148.     of two, which affects the dynamic range (i.e. the lowest to
  149.     highest amplitude) of a particular digital system.
  150.  
  151.     Digital conversion produces a sample value, and this is done at
  152.     a discrete sampling frequency so that points of a continuous
  153.     analog waveform are approximated by a set of digital values.
  154.     These digital values can be stored into the computer's memory
  155.     and played back to reproduce an approximation of the original
  156.     analog waveform.  The process of rebuilding an analog waveform
  157.     from digital samples requires that the samples are "played back"
  158.     at a rate similar to the rate at which the samples were
  159.     originally obtained.  To do this, each sample is transformed
  160.     from a digital value to an analog value (using a digital-to-
  161.     analog converter, or DAC) and this is done for all of the stored
  162.     samples at the chosen sampling frequency.  Thus, an
  163.     approximation of the original analog waveform can be reproduced.
  164.  
  165.     The accuracy of sampling thus depends on two major variables:
  166.     the sampling rate and the number of possible sample values.  The
  167.     sampling rate can affect accuracy since it defines the highest
  168.     possible frequency from the original waveform that can be
  169.     sampled.  The Nyquist sampling theorem dictates that the
  170.     sampling rate must be at least twice the frequency of the
  171.     highest frequency component to be sampled.  Thus, frequencies
  172.     greater than one-half the sampling frequency (the Nyquist limit)
  173.     will not be sampled accurately.  Attempting to surpass this
  174.     limit will introduce errors into the sampled waveform.  To get
  175.     around this limitation in practical sampling systems (e.g.
  176.     digital Compact Disc recording and playback, etc.), engineers
  177.     utilize low-pass filters which attenuate signals of frequencies
  178.     higher than the Nyquist limit prior to digital sampling.  For
  179.     CDs, which have a sampling rate of 44.1 kHz, these low-pass
  180.     filters begin attenuating at about 21 kHz and have reduced the
  181.     signal at the Nyquist limit of 22.05 kHz almost entirely.  Thus,
  182.     a CD can have data sampled upto about 22 kHz, but no higher, and
  183.     is thus "bandwidth-limited."  Sampling any higher frequencies
  184.     would create undesirable noise in the output.  (Note that 44.1
  185.     kHz is chosen because it is about the lowest value for
  186.     accurately sampling the spectrum of frequencies important in
  187.     musical signals; about 15 Hz to 20 kHz.  Any higher value would
  188.     be unnecessary and would require an increase data storage, an
  189.     obvious limitation for a system with two digital PCM channels
  190.     and error-correction data included with the PCM data).
  191.  
  192.     The second limitation to accurate PCM sampling is related to the
  193.     number of bits each sample contains.  CD sampled material is 16-
  194.     bit PCM.  This corresponds to a dynamic range of about 96
  195.     decibels (dB).  Systems using smaller sized samples will
  196.     obviously have lower dynamic range.  Thus, they will have an
  197.     inherently higher level of noise, and are inappropriate for
  198.     high-fidelity reproduction of sound.  Of course, the tradeoff
  199.     between sound quality and data storage is an important design
  200.     consideration in any PCM system.
  201.  
  202.  
  203.     Lesson 2.  Superposition:
  204.  
  205.     It is fairly easy to figure out what a sinewave looks like from
  206.     an oscilloscope plot.  You've likely heard what a sinewave
  207.     sounds like; pretty boring.  A simple sinewave can produce a
  208.     tone.  However, most sound that we hear and find pleasing has
  209.     much more content than a single sinewave.  Musical instruments
  210.     produce waveforms with a fundamental (do not confuse with my
  211.     terminology below; fundamental here refers to the primary
  212.     frequency created by an instrument) frequency (sinewave) and a
  213.     group of harmonic sinewaves at multiples of the fundamental.
  214.     These "harmonics" give each instrument a recognizable sound, or
  215.     timbre.  When we break up the waveform, it is possible to show
  216.     that the original waveform is thus the addition of the
  217.     fundamental sinewave and all of its harmonic sinewaves.  This
  218.     addition is called superposition.  Of course, superposition can
  219.     be both additive, or destructive.  Destructive superposition can
  220.     actually cancel out the amplitudes of two waveforms (for
  221.     example, if both are of the same frequency and amplitude, but
  222.     are 90 degrees out of phase; i.e. the peak of the first wave
  223.     corresponds to the trough of the second).  If you listen to two
  224.     sinewaves being reproduced by the FM chip on your sound card (if
  225.     you have one), you will be listening to superimposed sinewaves.
  226.     However, since your ear is able to pull out the discrete
  227.     frequencies in the signal, you hear two sinewaves (sort of like
  228.     the FFT routine described below).  Pretty neat, huh?
  229.  
  230.  
  231.     Lesson 3.  Fourier Transforms:
  232.  
  233.     Many of you may have seen programs that take PCM sampled sound
  234.     and output the data on the screen in an oscilloscope-like
  235.     display.  In this case, the plot is based on amplitude vs. time.
  236.     It is possible to determine the relative frequency of a
  237.     continuous waveform by varying the sweep-rate of such an
  238.     oscilloscope, but there are better ways to gather frequency data
  239.     from PCM samples.  One approach is to pass the data through an
  240.     algorithm called a Fast Fourier Transform (FFT) and to plot the
  241.     resulting data as a magnitude vs. frequency plot.  Essentially,
  242.     the FFT loops thru a group of samples and pulls out all of the
  243.     sinewaves contained in the sampling period (delta).  Since we
  244.     know the sampling rate (and thus, the time between samples), it
  245.     is possible to assign frequency values to the sinewaves
  246.     determined by the FFT.  So, the Fourier Transform works like the
  247.     superposition principle in reverse.
  248.  
  249.     The first sinewave is the lowest possible sinewave that can be
  250.     sampled accurately by the FFT, and corresponds to the sampling
  251.     frequency divided by the number of samples in delta.  I refer to
  252.     this as the fundamental frequency of the plot, F-fund.  The
  253.     frequency band plotted is twice F-fund, and the next is 3X, and
  254.     so on.  Thus, the plotted bands continue up by multiples of F-
  255.     fund until we reach the Nyquist limiting frequency (F-Ny), which
  256.     incidentally has a band number equal to 1/2 the number of
  257.     samples in delta (band number is also called channel number; one
  258.     band is plotted for each frequency displayed by MicFFT for a
  259.     particular sampling frequency).  Generally, data is plotted in
  260.     by linear scaling along the frequency axis, which means that
  261.     each band plotted represents one frequency.  However, it should
  262.     be noted that frequencies located between two discrete bands
  263.     will be represented as maximal deflections of the two bands on
  264.     either side of this intervening frequency.  Additionally, even
  265.     band-centered frequencies will produce deflections of those
  266.     bands adjacent to it, tapering off as we move in either
  267.     direction from the center band.  One should use care when
  268.     ascribing a particular group of frequencies to a particular
  269.     plot; as you work with MicFFT, you will get an idea of what to
  270.     expect.
  271.  
  272.  
  273.     MicFFT Usage:
  274.  
  275.     When you start MicFFT with the appropriate command line
  276.     arguments (see Options), you will be able to begin sampling
  277.     signals entering the ADC.  Whistle into a microphone connected
  278.     to the sound card.  You should see a peak, corresponding to the
  279.     frequency of the whistle.  Since the whistle is produced at the
  280.     lips, there is little interaction with the resonant cavities or
  281.     the body that normally introduce harmonics in speech and
  282.     singing.  Thus, whistling approximates a sinewave and can be
  283.     used to test MicFFT for simple waveforms.  Vary the pitch of
  284.     your whistling.  By reducing the pitch, you should see this peak
  285.     move to the left, thus indicating that the frequency is moving
  286.     lower.  By raising the pitch, the peak should move to the right
  287.     of the plot (note that the degree of peak movement will be
  288.     affected by the chosen sampling frequency).  Note the ruler at
  289.     the bottom of the plot screen.  This ruler corresponds to the
  290.     multiples of the fundamental frequency.  Ones are in white,
  291.     fives are in orange and tens are in red.  You can use the ruler
  292.     to get an instant idea of the relative frequency during
  293.     sampling.
  294.  
  295.     It is now possible to freeze the plot by pressing the SPACE bar.
  296.     Do this while continuing to whistle.  Once the sampling has
  297.     stopped and you have a frozen waveform frequency spectrum on the
  298.     screen, you can use the arrow keys to move a cursor line around
  299.     the plot.  Move the cursor line to the peak.  Below, you will
  300.     see the frequency for this peak, as well as the amplitude (in
  301.     magnitude returned by the FFT routine, and based on a maximum of
  302.     128; and in dB, relative to a dynamic range from 1 to 48 dB for
  303.     the 8-bit samples).  Note that the power density is related to
  304.     the area under the peak; the magnitudes shown are plotted only
  305.     for the band under the cursor line.
  306.  
  307.  
  308.     Keys for Freeze Window:
  309.  
  310.     To move the cursor line around, use the LEFT or RIGHT keys for
  311.     single band movements.  To speed up movement around the plot,
  312.     use CTRL-LEFT or CTRL-RIGHT to move ten bands for each keypress.
  313.     To move to the right end of the plot, press END or PGDN; to move
  314.     all the way to the left side, use HOME or PGUP.  To return to
  315.     the sampling mode, press the SPACE bar.  To exit the program at
  316.     any time (during sampling or in the freeze window), press ESC.
  317.  
  318.  
  319.     Options:
  320.  
  321.     MicFFT v1.1 has a number of options which are set by command
  322.     line arguments using specified flags.  Typing MicFFT at the DOS
  323.     prompt without any flags will run the program with the built-in
  324.     defaults.  You can override these defaults using the following
  325.     flags:
  326.  
  327. -?:    Display command line options.  Also -h.
  328.  
  329. -f:    Change the sampling frequency.  -f25000 will change the 
  330.         sampling frequency to 25 kHz.  Valid range is from 1 Hz (which
  331.         would take 256 seconds before the first plot; not
  332.         recommended...) and the highest sampling rate of your sound
  333.         card.  For the Covox card, this is 25000 (although I've been
  334.         able to get upto 34090 Hz before getting sampling problems).
  335.         For the Sound Blaster, this is 13 kHz.  Play around with this
  336.         option a lot.  Default is 10000.
  337.  
  338. -p:    Change the default ADC port address.  Default is 22F 
  339.         (hex), which corresponds to the default for the Covox card.
  340.         -f24fh will change to port address/offset 24F.  If you use the
  341.         Sound Blaster mode (see -b flag), the default will be 220.  Note
  342.         that if you supply a hexidecimal address, use an "h" following
  343.         the address to signify that you are using a hex address.
  344.         Decimal addresses are assumed and require no h at the end.
  345.         MicFFT will report the address chosen, so you can verify that
  346.         the correct address has been selected.
  347.  
  348. -b:    Change the sound card mode.  The default is the Covox mode 
  349.         (see Sound Cards, above), which is -b0.  For Sound Blaster mode,
  350.         use -b1.
  351.  
  352. -m:    Scaling mode.  Set to -m1 for maximum amplitude mode.  In 
  353.         this mode, all amplitude data is scaled on the plot so that all
  354.         amplitudes are scaled to the amplitude of the highest peak in
  355.         the plot.  Set to -m0 for log amplitude scaling; log amplitude
  356.         scaling is in dB, so this may be more suitable for some signals.
  357.         -m0 is the default.
  358.  
  359. -l:    Line mode.  Set to -l1 for line plot mode.  In this mode, 
  360.         lines are drawn between points corresponding to amplitudes of
  361.         successive bands.  Set to -l0 for bar graph mode.  In this mode,
  362.         each frequency band is plotted distinctly, from the bottom of
  363.         the plot to each amplitude point.  -l0 is the default.
  364.  
  365. -c:    Cosine envelope.  Type -c to turn on the cosine envelope 
  366.         function.  This adds a filter that prescales the data to remove
  367.         discontinuities at either end of the waveform before entering
  368.         the FFT routine.  This may produce a more stable display for
  369.         waveforms that are not rapidly changing.
  370.  
  371. -s:    Squelch mode.  To remove low-level noise from the input, 
  372.         to clean up the plot, use -s.  This removes any samples above
  373.         and below the zero level.  For example, -s10 will remove all PCM
  374.         samples between -10 and +10.  Use this option carefully, since
  375.         it can create square-waves, which have a variety of frequency
  376.         components that will polute the spectrum.  I do not recommend
  377.         values of greater than, say 10.
  378.  
  379. -e and -v:  Force EGA or VGA mode, respectively.  The default is 
  380.         to use the maximum resolution of the monitor, based on the mode
  381.         the monitor is set to when MicFFT is started.  -e has lower
  382.         resolution, but may be faster on some VGA monitors.  It also
  383.         produces a somewhat larger plot.  -v was added for consistency.
  384.  
  385.  
  386.     Note that all options can be entered using either the - or /
  387.     switch.  Case is not important, but you must not include white
  388.     spaces for any particular flag, since MicFFT will ignore any
  389.     options that do not conform to this syntax.  Order is also not
  390.     important, since the options are collected and verified before
  391.     any setup occurs.  I recommend that you create a batch file that
  392.     has your required configuration (for example, port and plotting
  393.     mode specs) along with a couple of %n's to allow additional
  394.     parameters to be entered.  For example:
  395.  
  396.            @echo off
  397.            REM RUNMF.BAT  --  Batch for running MicFFT with set config.
  398.            MicFFT -p24Fh -m1 -l1 %1 %2 %3 %4
  399.  
  400.  
  401.     Performance:
  402.  
  403.     As stated above, MicFFT frequency accuracy should not be
  404.     affected by different machine speeds, since the sampling is done
  405.     in a loop separate from the other routines, and uses the PC's
  406.     internal 8253 timer chip for accuracy in the fractional
  407.     microsecond range.  However, the Sound Blaster mode may not be
  408.     as accurate, because a number of additional steps are required
  409.     for sampling that will certainly increase the processing time.
  410.     Since I don't have a Sound Blaster card, it is not possible for
  411.     me to test this out.  Chris Pye, who wrote the Sound Blaster
  412.     routines, has observed frequency problems, but only when the
  413.     sampling rate exceeded 13 kHz.  Try this out for yourself.  If
  414.     you use a tuning fork (or some other stable frequency
  415.     generator), you should get approximately similar frequency peaks
  416.     at different sampling frequencies.  Keep in mind that any error
  417.     introduced by this extra processing will affect high sampling
  418.     rates.  Thus, compare low rates with very high rates.  If the
  419.     frequency display is stable, everything should be pretty
  420.     accurate.
  421.  
  422.     I have noticed that it is not possible to sample at a rate
  423.     higher than 34090 Hz (not even 34091!) on the Covox card.  When
  424.     I try, I get no output (or output only in the first channel).  I
  425.     don't know why this occurs, but it is probably related to the
  426.     way in which this specific card samples data, as well as my
  427.     machine's clock rate (33 MHz).  I assumed that I would see a
  428.     smearing of frequency at these higher rates (i.e. shifting to
  429.     reflect a lower actual rate than set by the program), but rather
  430.     this is a brick wall beyond which sampling doesn't work.  In a
  431.     way, I much prefer this, since it helps to know that the program
  432.     is accurate upto this maximum rate.  Again, it is important to
  433.     test this out on each system, if you are really interested in
  434.     accurate, high-frequency sampling.  In this respect, I may move
  435.     to DMA-controlled PCM sampling support for the Sound Blaster Pro
  436.     and Pro Audio Spectrum cards in future releases.  This would
  437.     allow the card itself to do the work of ensuring accurate
  438.     sampling.
  439.  
  440.     The refresh rate (i.e. the amount of time between sampling
  441.     periods) will vary, depending on the machine used.  MicFFT is
  442.     set up to sample 256 data points, transform and plot out the
  443.     data, then repeat this.  On slow machines, the refresh rate will
  444.     be low; on fast machines, particularly those equipped with
  445.     floating-point coprocessors, it will be impressively fast.
  446.     Nevertheless, it is important to stress that the time spent
  447.     processing the data is time spent not sampling.  Thus, events
  448.     occuring between sampling periods will be ignored.  This may be
  449.     problematic with time-varying signals, particularly those with
  450.     substantial transient components.  For this reason, it is
  451.     necessary to carefully analyze the plot for such data.
  452.     Sometimes, the plot will miss these transients.  If this is a
  453.     concern, I suggest slowing the sampling rate to the lowest
  454.     allowable frequency (based on the bandwidth of the signal), as
  455.     this will increase the chance of capturing this varying signal
  456.     in the plot.  You can freeze a waveform, but this is difficult
  457.     with rapidly varying signals.  A more suitable approach would be
  458.     to sample the waveform and select the parts of a time-domain
  459.     plot to display.  Future versions of MicFFT will include this
  460.     feature.
  461.  
  462.     Also, it is important to be cognisant of the Nyquist limit for
  463.     any particular waveform, as signals with components exceding the
  464.     limit will be "aliased" and not represented properly by the
  465.     spectral plot.  As I described above, frequencies above the
  466.     Nyquist limit will produce errors (aliasing) unless these are
  467.     removed from the signal before they are sampled.  This is
  468.     interesting in one respect: set the sampling frequency to about
  469.     4000 Hz and start a low whistle.  As you increase the frequency,
  470.     you will notice that the peak wraps around as it moves to the
  471.     right side of the plot.  If it goes far enough, it will also
  472.     wrap around the left side of the plot as well.  This a very
  473.     graphic demonstration of aliasing.  Beyond the academics,
  474.     aliasing can be a serious problem to accurate spectral analysis.
  475.     MicFFT does not yet have any low-pass filtering built in
  476.     (although future versions may include this), so you will have to
  477.     consider aliasing when chosing a particular signal and sampling
  478.     frequency.  If you are capable, it is possible to add a low-pass
  479.     filter to the input line of your signal generator (or mic) to
  480.     eliminate these higher frequencies.  Your sound card may even
  481.     provide for this type of bandwidth limiting.
  482.  
  483.     MicFFT is not designed to compete with hardware spectrum
  484.     analyzers (not yet, at least).  But, since these hardware
  485.     analyzers are many thousands of dollars, the cost of this
  486.     approach is more suitable for many applications, particularly
  487.     experimentation into sound, etc.  Although you may come up with
  488.     interesting ideas, I don't yet recommend its use in building the
  489.     next-generation Hubble Telescope, etc.  However, it might work
  490.     really well in analysis of Cold Fusion experiments.  If you have
  491.     any results in this arena, please inform me so I can buy the
  492.     stock (SEC, just kidding already!).
  493.  
  494.  
  495.     Acknowledgements:
  496.  
  497.     I'd like to take this opportunity to thank many of you who
  498.     downloaded MicFFT v1.0 and sent comments to me about the
  499.     program.  Since I've not asked for a fee for the program, at
  500.     least it gives me a little ego boost, and makes the programming
  501.     a bit more fun.
  502.  
  503.     Chris Pye has been instrumental in making MicFFT compatible with
  504.     Sound Blaster cards.  He also provided code for the freeze-
  505.     window routine and the cosine-envelope option.  He knows a lot
  506.     more about Fourier transforms than I (I'm a molecular biology
  507.     grad student, and just a engineering/physics hacker), and I'll
  508.     be working with him a lot in the future for developing better
  509.     versions of the program.  Additionally, the FFT routines used in
  510.     this program are based on those implemented in an archive called
  511.     FFT.ARC found on Compuserve by the author Steve Sampson, as well
  512.     as those found in a book called Numerical Recipes in C.  The
  513.     8253 timer routines (which have extraordinary accuracy) are
  514.     based on a Compuserve archive called TIMERH.ARC, uploaded by the
  515.     author Micahel Walraven.  I am indebted to the work of these
  516.     authors.
  517.  
  518.  
  519.     Conditions of Use:
  520.  
  521.     MicFFT v1.1 is currently freeware.  However, if you use the
  522.     program, I ask that you contact me (see Contacting The Author)
  523.     to let me know what you are using it for, its fitness, and other
  524.     comments, problems, etc.  When and if I decide to charge for my
  525.     work, I'll won't require this.  When I download programs I find
  526.     interesting, I often notify the author out of courtesy.
  527.     Usually, I get lots of ideas as well.  You may find that such
  528.     discourse can be fun and interesting.  On the other hand, you
  529.     may find that I don't know anything about this stuff.  You'll
  530.     just have to try me.  The code for MicFFT is not available,
  531.     unless you make specific arrangements with me first.  The main
  532.     reason for this is that I want to maintain control of the
  533.     development of the program.  If you have good ideas, and are
  534.     proficient in coding, I'll make exceptions.
  535.  
  536.  
  537.     Contacting The Author:
  538.  
  539.     You can contact me at the following E-mail addresses:
  540.  
  541.     Compuserve 70701,1614
  542.     Internet: walsh@biovx1.dnet.nasa.gov
  543.  
  544.     (Incidentally, I don't work for NASA, but our mail-server here
  545.     at UCLA is named this way for some strange reason).
  546.  
  547.     I can also be contacted by phone at my Los Angeles residence at
  548.  
  549.     (310) 390-0598
  550.  
  551.     Please note that I'd prefer to get mail via Internet, since my
  552.     Compuserve bills have been skyrocketing (and I'm just a poor,
  553.     lowly grad student).  You can do this on Compuserve by sending
  554.     the mail to an Internet address (see the help screen for the
  555.     specifics here.  I don't recall offhand how to do this).  I
  556.     check my mail on the Internet on a daily basis; I check
  557.     Compuserve much less frequently.  For a super low-tech approach,
  558.     you can send a post via hardcopy to:
  559.  
  560.     Craig Walsh
  561.     12420 Woodgreen Ave #203
  562.     Los Angeles, CA 90066
  563.  
  564.  
  565.     Have fun, and good luck with MicFFT v1.1.  Let me know what you
  566.     think.
  567.